#!/bin/bash

# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set -e

VAR_DIR="/var/lib/chrome-remote-desktop"
HASHES_FILE="$VAR_DIR/hashes"

save_hash() {
  if [ -f "$1" ]; then
    mkdir -p "$VAR_DIR"
    md5sum "$1" >> "$HASHES_FILE"
  fi
}

case "$1" in
  "install" | "upgrade")
    rm -f "$HASHES_FILE"
    save_hash /opt/google/chrome-remote-desktop
    ;;
esac

#DEBHELPER#
